//
//  ViewController.m
//  progress
//
//  Created by Stan on 2017-01-27.
//  Copyright © 2017 stan. All rights reserved.
//

#import "ViewController.h"
#import "SectorProgress.h"
#import "BallProgress.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet SectorProgress *sectorView;
@property (weak, nonatomic) IBOutlet BallProgress *ballView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    设置扇形的初始默认值，不然页面刚加载出来会是空白，很突兀
    self.sectorView.progress = 0;
    self.ballView.progress = 0;
    
}

- (IBAction)sliderValueChanged:(UISlider *)sender {
    
    //    对进度条进行赋值，同时对数值进行安全处理
    self.lineView.progress  =  (sender.value - sender.minimumValue) / (sender.maximumValue - sender.minimumValue);
    
//    对扇形进度器进行赋值
    self.sectorView.progress = self.lineView.progress;
    
//    对球形指示器进行赋值
    self.ballView.progress = self.lineView.progress;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end
